{% load i18n %}

{% get_current_language as cur_lang %}
{% get_available_languages as languages %}
{% get_language_info_list for languages as langs %}
<div id="langselector" class="modalDialog">
  <form action="{% url 'set_language' %}" method="post">{% csrf_token %}
  <input type="hidden" name="next" value="{{request.path}}" />
  {% trans "This page is also available in the following languages:" %}
  {% for l in langs %}
  <button class="{% if cur_lang == l.code %}current{% endif %}"
      title="{% trans l.name %}" name="language" value="{{l.code}}">{{l.name_local}}{% if not forloop.last %}, {% endif %}</button>
  {% endfor %}
  </form>
</div>
